|
|
IMHO you should use ReadBytes instead of ReadByte , then you can read all 5 at once instead of 1 at a time.
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
IMHO you should use ReadBytes instead of ReadByte, then you can read all 5 at once instead of 1 at a time.
While that's true, internally they'd both be using 128 byte or higher read ahead buffers I think. But then you are very much correct of course
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
|
First of all am I in the right Forum?
I'm thinking of making a simple peer to peer game in C# using remoting and WinForms. I would most likely need to send simple things like X,Y coordinates to each peer. My question is how should I accomplish this? The only method I can think of is storing each player's coordinates in a simple file then have each peer read each others coordinate file. This approach I beleive would operate poorly and would be extremely slow. I know there must be another way, does anyone here know how other games communicate or how I might go about doing this? Thanks for your time.
|
|
|
|
|
You could make a server module that people would sign into and have it control the sessions. This would be like what Unreal Tournement uses (I belive). Once the server is running on a computer, then the others could sign in and use other features such as finding players to play with, watching games already in progress, or replacing someone else in a running game. It seems more sensible to have a host in charge of communications which could be placed on another computer if the load is heavy so as not to slow any one down who is playing.
Rocky Moore
|
|
|
|
|
If you go to http://www.gotdotnet.com/team/csharp, you'll find my implementation of Spacewar!, which uses UDP over sockets.
The source is included; look on the information page.
|
|
|
|
|
How can I specify app.Path as I do in VB6? I am trying to point to a .txt file that I have included in the folder of the application. Any suggestions?
P.S. - While I am at it, is there any specific way to do a Debug.Print ? We used to have an immediate window in VB6 that allowed for this which was great for testing purposes. Thanks.
Nick Parker
|
|
|
|
|
System.Windows.Forms.Application.ExecutablePath tells you where the executable is located that started the application. You can also use the StartupPath property, they both appear to do the same thing.
System.Diagnostics.Debug class has lots of methods for you to use; there is also the System.Diagnostics.Trace class which I use more often for no justifiable reason .
James
Simplicity Rules!
|
|
|
|
|
Thanks James, that's exactly what I was looking for.
Nick Parker
|
|
|
|
|
Has anyone played with the Microsoft Messenger API in C#? For some reason I cannot get it to sink and event (assign a delegate).
Rocky Moore
|
|
|
|
|
I didn't even know that they had one. What all can it do? And where can I get it from?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
|
Rocky Moore wrote:
It is COM but here is the link:
Thanks! I was hoping there was a fully .NET version
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Does Messenger have native support for .NET now?
The last time I looked it was still COM, or is this what you're having problems with?
Cheers,
Simon
"Every good work of software starts by scratching a developer's personal itch.", Eric S. Raymond
|
|
|
|
|
I Createed a WindowsApplication in c#. I Noticed all the Console.* functions still compile but of course no console appears. How can i make the console show up?Its usefull to print messeges to there for debug
thank you
|
|
|
|
|
why not write the debug info in a textbox?
|
|
|
|
|
You can log all messages to a file for debugging purposes
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
If you want, you can compile your application as a console application, and it will still work as a windows app (forms and all) but the console will always be displayed.
You can change the type from the Project's properties dialog.
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
If you want, you can compile your application as a console application
Blast! Why didn't I think of that
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Even better is to use the log4net framework. Allows you integrate logging into your application. See: http://sourceforge.net/projects/log4net/
This way you can enable logging for a particular part of your application without having to change any source or recompile. Just modify the configuration file.
Phil Bolduc
Vancouver, BC Canada
|
|
|
|
|
I am trying to overload this method on a form and capture the WM_LBUTTONDOWN message. I am fairly new to C# and could someone guide me how to do it.
Thanks
|
|
|
|
|
Handle the MouseDown event
create a function like this
public class MyForm : System.Windows.Forms.Form {
protected override void OnMouseDown(MouseEventArgs e) {
if (e.Button == MouseButtons.Left)
MessageBox.Show(this, "You clicked the left button");
else
MessageBox.Show(this, "You clicked some other button");
}
}
|
|
|
|
|
Hi All,
I am still stuck trying to get some Crystal Reports working.
From what I have found out all my code is correct and I must just be missing something else.
Now the thing is I have no idea what that something else is.
I have downloaded the samples from Crystal Decisions and used them and I get the same error message.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
CrystalDecisions.Web..get_7() +189
CrystalDecisions.Web.CrystalReportViewer.OnInit(EventArgs e) +352
System.Web.UI.Control.InitRecursive(Control namingContainer) +235
System.Web.UI.Control.InitRecursive(Control namingContainer) +179
System.Web.UI.Control.InitRecursive(Control namingContainer) +179
System.Web.UI.Page.ProcessRequestMain() +169
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
Could someone please tell me what I am doing wrong here?
Thanks,
Gavin
|
|
|
|
|
Hello Friends,
I'm developing one MDI application.
In that I want to perform some task in ACtivated() event of each child.But whenever I'm activating MDIChild, activated() event of that child is not firing. Thats why I'm unable to perform my task.
Has anybody having any idea about this.
Thanks in advance.
Pranoti
|
|
|
|