public void NotifyAllClientDelegates(Buf data) { // We can call the method directly if we are calling this from the player if (isLocalPlayer || myBase.myInput.isBot()) { /* Server verification method */ if (((ServerVerifyClientNotification)verifications[data.methodName]).Invoke(data)) { BufWrapper bufW = new BufWrapper(); bufW.buf = data; bufW.index = myComponentIndex; ((OnClientNotify)delegates[data.methodName]).Invoke(data); CmdNotifyAll(bufW); } else { Debug.LogError("Request was denied by the server. We should probably kick this player."); } } else { Debug.LogWarning("You are not the owner of this object! Not sending any data."); } }
void RpcAddBuf(BufWrapper data) { //Debug.Log("adding buf at index " + data.index + " which is " + myComponents[data.index]); if (myBase != null) { for (int i = 0; i < myComponents.Length; i++) { if (i == data.index) { myComponents[i].bufData = data.buf; myComponents[i].BufChanged(); } } } }
public void CmdNotifyAll(BufWrapper data) { RpcAddBuf(data); }