public void ReceiveObject(object obj, org.umundo.core.Message msg) { DistCalendarEvent distEventObj = (DistCalendarEvent)obj; if (distEventObj != null) { frmCalendarMain.ReceiveDistEvent(distEventObj); frmCalendarMain.notifyStatus = "Event Object Received!"; } }
/// <summary> /// Prepare/Send the message to broadcast(publish). /// </summary> private void BroadcastMessageSend() { org.umundo.core.Message msg = new org.umundo.core.Message(); msg.putMeta("userName", Globals.Username); msg.putMeta("newScore", Globals.Score.ToString()); msg.putMeta("xPos", Globals.Players.xPos.ToString()); msg.putMeta("yPos", Globals.Players.yPos.ToString()); pub.send(msg); }
/// <summary> /// Receives the uMundo message. /// </summary> /// <param name="msg">The umundo core message.</param> public override void receive(org.umundo.core.Message msg) { if (msg.getMeta().ContainsKey("participant")) { //If greeting is received Globals.Participants.Add(msg.getMeta("subscriber"), msg.getMeta("participant")); Globals.Players.Names.Add(msg.getMeta("participant").Split(';')[0]); Globals.Players.Scores.Add(msg.getMeta("participant").Split(';')[1]); UpdateScoreLocal(); } else { //Called when someone else scores Helper.AddScore((msg.getMeta("userName"))); RelocateFly(int.Parse(msg.getMeta("xPos")), int.Parse(msg.getMeta("yPos"))); UpdateScoreLocal(); } }