public CalendarEvent_v1() { this.triggerDate = new DateTime(); this.uiState = CalendarEvent.UIState.None; this.triggerState = GameState.Type.None; this.OnButtonClick = (MMAction)null; this.OnEventTrigger = (MMAction)null; this.message = (Message)null; this.effect = (EventEffect)null; this.displayEffect = (DisplayEffect)null; this.category = CalendarEventCategory.Unknown; this.mustRespond = false; this.interruptGameTime = false; this.showOnCalendar = false; this.mCachedDynamicDescriptionTextID = (string)null; }
public CalendarEvent_v1(CalendarEvent v0) { this.triggerDate = v0.triggerDate; this.uiState = v0.uiState; this.triggerState = v0.triggerState; this.OnButtonClick = v0.OnButtonClick; this.OnEventTrigger = v0.OnEventTrigger; this.message = v0.message; this.effect = v0.effect; this.displayEffect = v0.displayEffect; this.category = v0.category; this.mCachedDynamicDescriptionTextID = v0.description; this.mustRespond = v0.mustRespond; this.interruptGameTime = v0.interruptGameTime; this.showOnCalendar = v0.showOnCalendar; }
/// <summary> /// Sends a json string to all the players /// </summary> /// <param name="json">Json.</param> public void SendUpdate(int ObjectID, string ActionMethod, Vector3 NewLocation, float NewVelocity, string NewChat) { //make sure we are connected if (m_hasConnected == false) { return; } //assemble the data to send to users MMAction NewAction = new MMAction(); NewAction.ObjectID = ObjectID; NewAction.ActionMethod = ActionMethod; NewAction.NewLocation = NewLocation; NewAction.Velocity = NewVelocity; NewAction.Chat = NewChat; //convert to json var PacketData = JSON.Dump(NewAction, true); if (SMM.Instance.DebugTextOn) { Debug.Log("" + m_ID + ": " + PacketData); } for (int i = 0; i < SMM.Instance.m_PlayerList.Count; i++) { if (SMM.Instance.GetSteamPersonaName().ToLower() != SMM.Instance.m_PlayerList[i].steamPersonaName.ToLower()) { //convert our json to bytes byte[] packetBytes = Encoding.ASCII.GetBytes(PacketData); //send the packets to the user SteamNetworking.SendP2PPacket(m_CurrentPlayer.lobbyID, packetBytes, (uint)packetBytes.Length, Steamworks.EP2PSend.k_EP2PSendReliable, 0); } } }