binary optimization
This commit is contained in:
@@ -87,7 +87,6 @@ export default class DataManager extends Singleton {
|
||||
player.direction = { x, y }
|
||||
break
|
||||
}
|
||||
|
||||
case InputTypeEnum.WeaponShoot: {
|
||||
const { owner, position, direction } = input
|
||||
const bullet: IBullet = {
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import Singleton from '../Base/Singleton'
|
||||
import { ApiMsgEnum, IModel, strdecode, strencode } from '../Common';
|
||||
import { binaryEncode } from '../Common/Binary';
|
||||
import { binaryDecode } from '../Utils';
|
||||
import { binaryEncode, binaryDecode } from '../Common/Binary';
|
||||
|
||||
const TIMEOUT = 5000
|
||||
|
||||
@@ -94,8 +93,6 @@ export default class NetworkManager extends Singleton {
|
||||
|
||||
sendMsg<T extends keyof IModel['msg']>(name: T, data: IModel['msg'][T]) {
|
||||
const view = binaryEncode(name, data)
|
||||
console.log("view", view.buffer);
|
||||
|
||||
this.ws.send(view.buffer)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user