|
I want to develop tic-tac-toe game online for two users and
SQL Server I will use to save players move and broker i will use to notify when soneone's turn to play, or should I use another way to notify user when is turn to make a move.
Thanks
|
|
|
|
|
It sounds like a bit overkill to have a paid version of Sql Server to play a tic-tac-toe game.
cdpsource wrote: should I use another way to notify user when is turn to make a move. There are multiple ways to inform a client of a change; if it's a small turnbased game between two players, I'd expect direct communication between those players, without the need for a server.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
We can't really answer that as is: there are far, far too many options.
One mans "multiplayer online game" is Halo4, another is Sims3, or Scrabble!
They need very, very different approaches, and trying to decide that you want "SQL Broker" to sort it all out before you look at how much data needs to fly around, and where and when it needs to fly is like deciding you want a 5.2l V8 engine, before you chose the curtains!
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
A simple publish subscribe mechanism should suffice.
|
|
|
|
|
I have a textbox control in my page i need to insert control values in single row with four columns. on every insert on textbox i need to store value in every column with particular cells
if 1st insert i need to insert data on row 1st column
on 2nd insert i need to insert data on row 2st column of same row
-----
With Thanks
ram
|
|
|
|
|
Is this an ASP.NET question ? If you are speaking of simulating columns in a TextBox, I suggest you don't try it. Even if you use a monospaced font, and tabs, you're still going to have a problem with alignment at some point, I predict. Use a grid, a ListView, etc.
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
OK, this is standard stuff. I take it you know nothing about SQL??
Google for "C# parameterized queries" and you'll find all kinds of information on how to do it.
|
|
|
|
|
Hi Ram,
It seems that in your case you are using same textbox for multiple inserts and also your table design limits it to 4 inserts on that textbox.
Although this type of design is not recommened (as per normalization guidelines) but the
solution for your case is
1. for 1st insert you have to execute insert statement for inserting value to 1st column in a new row.
2. for other inserts like 2nd, 3rd, 4th you have to run update sql statement, and for that you would be needing some primary key from the step1, if you don't have any then add identity column to your table it will add numeric primary key.
Or
you can also store inserted values from textbox to some local list variable and then on final save button click run insert sql statement with values for all the 4 columns, hence in this only database hit is required.
Regards,
Amit
|
|
|
|
|
I have a client who needs to get back the street address given a lat/long.
I have never done this before. Anyone have any experience with this? Are there services and/or API's I need? Can you point me in the right direction?
Many thanks
If it's not broken, fix it until it is
|
|
|
|
|
It's called reverse geocoding. There are many different services that you can use for this. You could use Bing maps, or Google maps. Here's[^] an entirely client side implementation of the Google lookup.
|
|
|
|
|
I should have mentioned...
1) They don't want to use Google. Cost prohibitive
2) This will probably all be in a WPF app. The LAT/LONG data will come from truck mounted GPS devices, and I will need to convert to addresses and store in SQL.
I've been Googling GeoCode Service and what would be nice is a .Net API I can use.
If it's not broken, fix it until it is
|
|
|
|
|
A lot of countries have addresses mapped to lat/long - if you can source this data locally, then you can save yourself some of the cost. For instance, here in the UK, we have the Ordnance Survey which takes care of a lot of this for us - combined with information from local councils.
|
|
|
|
|
Ok, I have no clue what all that means
If it's not broken, fix it until it is
|
|
|
|
|
You might get some traction with this[^].
|
|
|
|
|
I understand what Geocoding is. I don't understand how to code it. Again, I'm hoping for an API or other service that I can get started with.
If it's not broken, fix it until it is
|
|
|
|
|
You didn't look down the page, did you? And it's reverse geocoding that you're looking for, not geocoding. The link I posted shows the details of web service calls you can make to get the results. All you need to do is call into the service - I would opt for the json version if I were doing this.
|
|
|
|
|
So it is a cost thing!
Back in the old day - 2001 and in the UK again we could get postcode/geo info on CD from one of the mapping companies, it did cost but was reasonable. Postcodes in the UK represent as few as 6 houses.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
hi there !
i have BAD DATA EXP !
MY APP WORK FINE IN LOCAL BUT WHEN I RUN IT IN THE NETWORK THE SERVER APP THROW THE BAD DATA EXP !?
CODE : C#
CLIENT :
public byte[] ENC(string strdata, CspParameters prk)
{
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(prk);
byte[] data = rsa.Encrypt(Encoding.Unicode.GetBytes(strdata),false);
MessageBox.Show(data.Length.ToString()); return data;
}
void clint(byte[] data)
{
try
{
object op = (object)data;
BinaryFormatter br = new BinaryFormatter();
TcpClient myclient = new TcpClient("192.168.43.152", 7000);
NetworkStream myns = myclient.GetStream();
br.Serialize(myns, op);
myclient.Close();
}
catch (Exception e)
{
clint(data);
}
}
/////////////////
.
.
.
CspParameters cp = new CspParameters();
cp.KeyContainerName = "25522100";
string usb = ":RIO";
string Name = System.Environment.MachineName;
Name += usb;
mymsg = ENC(Name, cp);
clint(mymsg);
SERVER :
<pre> mytcp = new TcpListener(7000);
mytcp.Start();
mysocket = mytcp.AcceptSocket();
myns = new NetworkStream(mysocket);
BinaryFormatter br = new BinaryFormatter();
object op;
op = br.Deserialize(myns);
data = (byte[])op;
MessageBox.Show(data.Length.ToString());
CspParameters cp = new CspParameters();
cp.KeyContainerName = "25522100";
byte[] messge = DEC(data, cp);
//////////////////////
.
.
.
public byte[] DEC(byte[] en_data, CspParameters key)
{
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(key);
byte[] data1 = rsa.Decrypt(en_data, false);
return data1;
}
ANY HELP !
modified 7-Oct-13 12:35pm.
|
|
|
|
|
DON'T SHOUT
The IP-address is of a computer in local network; it will not be available on the internetz. You'll need to figure out your public IP and adjust the router to point to that specific server.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
its LAN network
there is server run windows server 2008
and pc run windows 7
thnx for ur help
|
|
|
|
|
|
Add some logging on the server side to find out where the exception gets thrown, and which data caused it.
|
|
|
|
|
|
Hi,
I am trying to send some text to notepad using SendKeys.Send("Hello World!") instead SendKeys.SendWait("Hello World!"). But I could not send and facing problem.
Error is:
"SendKeys cannot run inside this application because the application is not handling Windows messages. Either change the application to handle messages, or use the SendKeys.SendWait method."
Thank you
namespace Send_Key
{
class Program
{
[DllImport("user32.dll", SetLastError = true, EntryPoint = "FindWindow", CharSet = CharSet.Auto)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", SetLastError = true, EntryPoint = "SetForegroundWindow")]
static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true, EntryPoint = "ShowWindow")]
static extern bool ShowWindow(IntPtr hWnd, int cmCommand);
static IntPtr hwnd;
static void Main(string[] args)
{
Process notePad = new Process();
notePad.StartInfo.FileName = "notepad.exe";
notePad.Start();
System.Threading.Thread.Sleep(1000);
SetForegroundWindow(hWnd);
System.Threading.Thread.Sleep(1000);
SendKeys.Send("Hello World!");
}
}
}
modified 7-Oct-13 5:14am.
|
|
|
|