var codestring = this.ball + " " + this.ball.position["x"] + " "
+ this.ball.position["y"];
_warpclient.sendPrivateUpdatePeers(enemy, codestring);
我使用此功能将同伴发送给定义名称为敌人的人。
function onSendPrivateUpdateDone (result){
console.log('Update done ' + result);
}
onSendPrivateUpdateDone
工作并向发送同伴的人写消息,这里https://apphq.shephertz.com/appWarp/index#/testManager注意到我的消息已发送,房间已创建并且玩家已连接到房间,但是must accept message 不会这样做,因为函数onPrivateUpdateReceived
回调什么都不做。
onPrivateUpdateReceived(userName, msg){
console.log("Username: "+userName);
console.log("Message: "+msg);
}