本文整理汇总了C#中SFSObject.PutInt方法的典型用法代码示例。如果您正苦于以下问题:C# SFSObject.PutInt方法的具体用法?C# SFSObject.PutInt怎么用?C# SFSObject.PutInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SFSObject
的用法示例。
在下文中一共展示了SFSObject.PutInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: asSFSObject
public SFSObject asSFSObject(int aRound) {
SFSObject s = new SFSObject ();
s.PutInt ("id",this.horseID);
s.PutUtfString ("c", this.compressedString(aRound));
s.PutLong ("o", this.ownerID);
s.PutInt ("u", SmartfoxConnectionHandler.REF.smartfoxuid);
return s;
}
示例2: OnLogin
void OnLogin(BaseEvent e)
{
Debug.Log("Welcome "+ e.Params["user"]);
ISFSObject objOut = new SFSObject();
objOut.PutInt("a",sumA);
objOut.PutInt("b",sumB);
_sfs.Send(new ExtensionRequest("SUM_INTS",objOut));
_sfs.Send(new JoinRoomRequest(roomName));
}
示例3: SendHealthChange
public void SendHealthChange(string ShooterName, int damage)
{
SFSObject message = new SFSObject ();
message.PutUtfString ("shooterName", ShooterName);
message.PutInt("damage",damage);
Room room = smartFox.LastJoinedRoom;
ExtensionRequest request = new ExtensionRequest("updateHealth", message, room);
smartFox.Send(request);
}
示例4: SendAnimationState
/// <summary>
/// Send local animation state to the server
/// </summary>
/// <param name="message">
/// A <see cref="System.String"/>
/// </param>
/// <param name="layer">
/// A <see cref="System.Int32"/>
/// </param>
public void SendAnimationState(string message, int layer)
{
Room room = smartFox.LastJoinedRoom;
ISFSObject data = new SFSObject();
data.PutUtfString("msg", message);
data.PutInt("layer", layer);
ExtensionRequest request = new ExtensionRequest("sendAnim", data, room);
smartFox.Send(request);
}
示例5: SendPublicMessageRequestFire
public void SendPublicMessageRequestFire(int myPlayerID, int shootPower, float directX, float directY)
{
SFSObject obj = new SFSObject();
obj.PutUtfString("username", userName + myPlayerID);
obj.PutInt("shootpower", shootPower);
obj.PutFloat("directx", directX);
obj.PutFloat("directy", directY);
sfs.Send(new PublicMessageRequest("playerfire", obj));
}
示例6: performAction
public void performAction(GameObject ourSSO)
{
RayCastManager ourRCM = ourSSO.GetComponent<RayCastManager>();
string astringID = ourRCM.currentRayCastObject.name.Split('_')[2];
ISFSObject aSFSObject = new SFSObject();
aSFSObject.PutInt("ID", Convert.ToInt32(astringID));
SmartFox SFServer = SmartFoxConnection.Connection;
SFServer.Send(new ExtensionRequest("GatherResource", aSFSObject));
}
示例7: performAction
public void performAction(GameObject ourSSO)
{
RayCastManager ourRCM = ourSSO.GetComponent<RayCastManager>();
string aSettlementID = ourRCM.currentRayCastObject.transform.parent.name.Split('_')[2];
ISFSObject aSFSObject = new SFSObject();
aSFSObject.PutInt("ID", Convert.ToInt32(aSettlementID));
SmartFox SFServer = SmartFoxConnection.Connection;
SFServer.Send(new ExtensionRequest("CenterNodeInformation", aSFSObject));
}
示例8: performAction
public void performAction(GameObject ourSSO)
{
Item usedItem = ourSSO.GetComponent<GameUI>().getCurrentInventoryItem();
ISFSObject aSFSObject = new SFSObject();
aSFSObject.PutInt("ID", usedItem.getItemID());
aSFSObject.PutUtfString("Name", usedItem.getName());
aSFSObject.PutUtfString("Sublocation", usedItem.getLocation());
SmartFox SFServer = SmartFoxConnection.Connection;
SFServer.Send(new ExtensionRequest("UseItem", aSFSObject));
}
示例9: SendStatusChange
void SendStatusChange()
{
pendingSend = false;
ISFSObject data = new SFSObject();
ISFSObject tr = new SFSObject();
if(sendHP){
Debug.Log("Sending status change: " + component.HP);
tr.PutFloat("currentHP", component.HP);
}
data.PutSFSObject(NetSyncObjCharacter.statusDS, tr);
data.PutInt("id", syncObj.ID);
SFSNetworkManager.Instance.SendNetObjSync(data);
}
示例10: updateXPData
public void updateXPData() {
SFSArray sfsArray = new SFSArray();
SFSObject r = new SFSObject();
r.PutDouble("Sp",this.speed);
r.PutDouble("Ac",this.accelerationBase);
r.PutDouble("Ju",this.jumping);
r.PutDouble("St",this._stamina);
r.PutDouble("Re",this.recovery);
r.PutDouble("Sl",this.stridelength);
r.PutDouble("Ca",this.cadence);
r.PutDouble("De",this.determination);
r.PutDouble("XP",this.xp);
r.PutInt("L",this.level);
r.PutInt("RT",this.trainingReturnTime);
r.PutInt("H",this.hunger);
r.PutInt("F",this.fatigue);
r.PutDouble("Ha",this.happiness); // Now double instead of int
r.PutDouble("Ho",this.horseScore); // Now double instead of int
r.PutDouble("Ma",this.maxMPH);
r.PutInt("ID",this.horseID);
sfsArray.AddSFSObject(r);
SmartfoxConnectionHandler.REF.sendHorsesArray("h_xp",sfsArray);
}
示例11: SendData
public void SendData(Transform a)
{
ISFSObject isfsO = new SFSObject();
isfsO.PutInt("Sender", sfs.MySelf.PlayerId);
isfsO.PutFloat("px", a.position.x);
isfsO.PutFloat("py", a.position.y);
isfsO.PutFloat("pz", a.position.z);
isfsO.PutFloat("rx", a.rotation.x);
isfsO.PutFloat("ry", a.rotation.y);
isfsO.PutFloat("rz", a.rotation.z);
sfs.Send(new ExtensionRequest(ConfigRequestCmd.cmd_playermove, isfsO, sfs.LastJoinedRoom));
}
示例12: SendMovementDirection
void SendMovementDirection()
{
if (lastMoveState.IsDifferent(component, accuracy)) {
if (timeLastSendingMove >= sendingPeriod) {
lastMoveState = CharPosEffComp.NetworkMoveDirection.FromComponent(component);
ISFSObject data = new SFSObject();
CharPosEffComp.ToSFSObject(lastMoveState, data);
data.PutInt("id", syncObj.ID);
SFSNetworkManager.Instance.SendNetObjSync(data);
timeLastSendingMove = 0;
return;
}
}
timeLastSendingMove += Time.deltaTime;
}
示例13: broadcastPositions
public void broadcastPositions() {
if(Time.time-lastBroadcastTime>MIN_TIME_BETWEEN_BROADCAST) {
SFSObject o = new SFSObject();
SFSArray h = new SFSArray();
for(int i = 0;i<this.sortedHorses.Count;i++) {
if(sortedHorses[i].currentPoint==null)
return;
h.AddSFSObject(sortedHorses[i].dataPackage);
}
o.PutSFSArray("a",h);
o.PutInt("f",this.framesPassed);
SmartfoxConnectionHandler.REF.sendRaceMessage("b",o);
lastBroadcastTime = Time.time;
}
}
示例14: SendResultant
void SendResultant()
{
//if (lastResultState.IsDifferent(component, accuracy)) {
if (timeLastSendingPos >= sendingPeriod) {
lastResultState = CharPosEffComp.NetworkResultant.FromComponent(component);
ISFSObject data = new SFSObject();
CharPosEffComp.ToSFSObject(lastResultState, data);
data.PutInt("id", syncObj.ID);
SFSNetworkManager.Instance.SendNetObjSync(data);
timeLastSendingPos = 0;
//Debug.Log("sending pos msg, id: " + syncObj.ID);
return;
}
//}
timeLastSendingPos += Time.deltaTime;
}
示例15: Cancel
public void Cancel()
{
UserVariable uv = new SFSUserVariable("Ready", "NO");
List<UserVariable> lUV = new List<UserVariable>();
lUV.Add(uv);
sfs.Send(new SetUserVariablesRequest(lUV));
RoomVariable rv = new SFSRoomVariable("ReadyCount", int.Parse(sfs.LastJoinedRoom.GetVariable("ReadyCount").Value.ToString()) - 1);
List<RoomVariable> lRV = new List<RoomVariable>();
lRV.Add(rv);
sfs.Send(new SetRoomVariablesRequest(lRV));
ISFSObject isfsO = new SFSObject();
isfsO.PutInt("Sender", sfs.MySelf.PlayerId);
sfs.Send(new PublicMessageRequest("PlayerCancel", isfsO, sfs.LastJoinedRoom));
}