简体   繁体   English

如何从ActionScript 3中的Socket接收命令?

[英]How to receive commands from Socket in Actionscript 3?

I finally managed to get a server working (after 2 days playing with java lol) so i can connect with it using sockets. 我终于设法使服务器正常工作(在使用Java哈哈2天后),因此我可以使用套接字与它连接。 But what bothers me is, let's say I connected both clients to the server using these sockets How can i send commands, for example attack from one client to the other? 但是令我困扰的是,我使用这些套接字将两个客户端都连接到服务器,如何发送命令,例如从一个客户端到另一个客户端的攻击?

I hope you get my point lol :/ PS:I'm using java for the server, as3 for the client 我希望你能理解我的观点:/ PS:我正在使用java作为服务器,使用as3作为客户端

Thanks in advance anyway... 还是要提前谢谢...

You need to add either BlazeDS (a little outdated) or GraniteDS (newer and in my opinion works better), I do think BlazeDS was a little easier to get going with. 您需要添加BlazeDS(有些过时)或GraniteDS(较新,并且我认为效果更好),我确实认为BlazeDS易于使用。

They are both based on using a java webservlet and actionscripts AMF format to allow communication with a flash/actionscript client. 它们都基于使用Java WebServlet和ActionScripts AMF格式来允许与Flash / ActionScript客户端进行通信。

The other option is to use some form of C/C++/C# to actually talk binary. 另一种选择是使用某种形式的C / C ++ / C#实际谈论二进制。 This is extremely efficient if you want to create your own protocol. 如果要创建自己的协议,这将非常有效。 On the other hand this means more work :). 另一方面,这意味着需要更多工作:)。

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

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