tehl33tjim Posted July 2, 2013 Author Share Posted July 2, 2013 I think I have the logic down, but I'm terrible at figuring out the correct syntax for this stuff.What I want to accomplish: Have a simple label on the Client (maybe even a picture box in the future) - normally this will have a (lblAnnouncement.caption = "No Announcements"), but I want to make a txtAnnounce text box and button (on the server form) that upon pressing will change the lblAnnouncement.caption.Client = txtAnnounce.text.Server for all players.I understand the basics of putting the actual pieces onto the windows (the txtBox and labels, etc). But I have no idea how the whole sending packets works. I assume I would also need something on form_load for the client's frmMain, but again - I don't know how to send stuff from the server to the clients.Can anybody point me in the right direction for that? I would appreciate it greatly, and it would be great to learn. Link to comment Share on other sites More sharing options...
Zeno Posted July 3, 2013 Share Posted July 3, 2013 The easiest way to do this is just to use the existing chatbox. GMs could change the message, which would be sent out every five or ten minutes to every player. This way, you don't have to worry about creating any infrastructure, maybe just a timer. Sending packets works on a send/handle system. Before sending, a packet is compiled starting with the packet's name (a string enumerated as a constant in modEnumerations) followed by any other information in the packet. All Send subs work this way. Then on the other end (client-side if sent from server, or vice versa), that number is read from the packet and then the rest of the packet sent to the appropriate handle sub, based on the address in modHandleData sub InitMessages(). Then the handle sub uses any remaining packet information to carry out the operation. It sounds a bit complicated, but once you get the hang of it, it becomes very simple and easy to use. For what you're looking to do here, the message of the day (MotD) packets would make a good example to look to.You could also just use an included MotD function. Although that text is usually sent only on logging in and when changed, it sounds like it would fit your bill. Link to comment Share on other sites More sharing options...
Slasheree Posted July 3, 2013 Share Posted July 3, 2013 so you want this to be activated by the server or the client ? o.otry using this: [http://www.eclipseorigins.com/community/index.php?/topic/133705-sending-a-string-to-a-label-server-client/#entry903465](http://www.eclipseorigins.com/community/index.php?/topic/133705-sending-a-string-to-a-label-server-client/#entry903465) Link to comment Share on other sites More sharing options...
Wortel Angels Posted July 3, 2013 Share Posted July 3, 2013 Send me an PM i can do it for you if you dont get it working Link to comment Share on other sites More sharing options...
tehl33tjim Posted July 4, 2013 Author Share Posted July 4, 2013 Sorry for not clearing this up earlier. I did get it to work, the major problem being a stupid one (forgetting to specify the form at one end.) Thank you guys for your help regardless. :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now