简体   繁体   English

服务器/客户端C#

[英]server/Client C#

I'm getting tired of working in vb.net, vb6, and C#. 我已经厌倦了在vb.net,vb6和C#中工作。 So i have decided to convert everything I'm using into one programming language which is C#. 所以我决定将我正在使用的所有内容都转换为一种C#编程语言。 My problem right now is what I should use for a 2-d game. 我现在的问题是我应该在2D游戏中使用什么。 I'm trying to build a client/server for a small 2-d game. 我正在尝试为小型2D游戏构建客户端/服务器。 What I need is to figure out which would be best for about a server that will most likely hold about 5 - 30 (maybe more) people at a time. 我需要弄清楚哪种服务器最适合同时容纳大约5-30(可能更多)人的服务器。 I heard UPD is better than TCP but I'm not sure. 我听说UPD比TCP更好,但我不确定。 I want to use BinaryWriter and BinaryReader with the server. 我想在服务器上使用BinaryWriter和BinaryReader。 Another part I'm having trouble to figure out is how to set it up so that the server will read data from the client but then call a function or a sbu and pass the data to that which will then handle it and create a file or do something else then if it needs to send data back to the server. 我要弄清楚的另一部分是如何设置它,以便服务器可以从客户端读取数据,然后调用一个函数或一个sbu并将数据传递给随后将处理该数据并创建一个文件或如果需要将数据发送回服务器,请执行其他操作。 Any help would be great. 任何帮助都会很棒。 Eventually I would like to use this client/server as a base for a small 3-D board game I'm working on in Unity3D. 最终,我想将此客户端/服务器用作我在Unity3D中工作的小型3-D棋盘游戏的基础。

For networked gaming where the 'action' is happening quickly, UDP is much better. 对于“动作”快速发生的网络游戏,UDP要好得多。 Rather than write a long paragraph, here is a link with similar thoughts to mine. 与其撰写冗长的段落,不如说是链接与我类似的想法。

http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/ http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM