public string RecordInsert(PropMessage objProperty, string associateID) { DllMessage objDal = new DllMessage(); try { return(objDal.InsertD(objProperty, associateID)); } catch (Exception info) { throw info; } finally { objDal = null; } }
public string InsertD(PropMessage objMessage, string associateID) { try { SqlCommand cmd = new SqlCommand("proc_Messages", objCon.Con); cmd.CommandType = CommandType.StoredProcedure; objCon.Con.Open(); cmd.Parameters.AddWithValue("@fromID", objMessage.fromID); cmd.Parameters.AddWithValue("@toID", objMessage.toID); //cmd.Parameters.AddWithValue("@subject", objMessage.subject); cmd.Parameters.AddWithValue("@bodytext", objMessage.bodytext); cmd.Parameters.AddWithValue("@action", "Add"); return(cmd.ExecuteScalar().ToString()); } catch { return("Not Valid"); } }
public string SendMessages(string bodytext) { string str = string.Empty; if (Session["associate"].ToString() != "" || Session["associate"].ToString() != null) { PropMessage proMessage = new PropMessage(); proMessage.fromID = Convert.ToInt16(Session["associate"]); proMessage.toID = -1; //proMessage.subject=subject; proMessage.bodytext = bodytext; BllMessage objMessage = new BllMessage(); str = objMessage.RecordInsert(proMessage, Session["associate"].ToString()); return(str); } else { return("Error in Authentication"); } }
// Send message periodically to tell clients who the hunter is // Must send periodically in case clients join mid-game private void SendPropMessageTag() { PropMessage msg = new PropMessage (); NetworkIdentity playerIdtt = this.GetComponent<NetworkIdentity>() as NetworkIdentity; msg.msgType = PropMessage.Type.Tag; msg.prop = playerIdtt.netId; msg.player = playerIdtt.netId; NetworkClient.allClients [0].Send (PropMessage.TypeId, msg); }
// send message when the player is respawned private void SendPropMessageRespawn() { NetworkIdentity playerIdtt = gameObject.GetComponent<NetworkIdentity>() as NetworkIdentity; if (playerIdtt == null) return; PropMessage msg = new PropMessage(); msg.msgType = PropMessage.Type.Respawn; msg.player = playerIdtt.netId; NetworkClient.allClients[0].Send(PropMessage.TypeId, msg); Debug.Log("Client sent: " + msg.player); }
// send message when the player change to a prop private void SendPropMessageChange(GameObject objHit) { NetworkIdentity objIdtt = objHit.GetComponent<NetworkIdentity>() as NetworkIdentity; NetworkIdentity playerIdtt = gameObject.GetComponent<NetworkIdentity>() as NetworkIdentity; if (objIdtt == null || playerIdtt == null) return; PropMessage msg = new PropMessage(); msg.msgType = PropMessage.Type.Change; msg.prop = objIdtt.netId; msg.player = playerIdtt.netId; NetworkClient.allClients[0].Send(PropMessage.TypeId, msg); Debug.Log("Client sent: " + msg.player + " " + msg.prop); }