Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Simple Client-side Notification activated by GMs?


tehl33tjim
 Share

Recommended Posts

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

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

so you want this to be activated by the server or the client ?  o.o

try 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...