1
This commit is contained in:
parent
cc60d5f801
commit
aaa22350f4
@ -30,7 +30,7 @@ pub struct PlayerNetHandler {
|
|||||||
|
|
||||||
impl cs_auto::MsgHandler for PlayerNetHandler {
|
impl cs_auto::MsgHandler for PlayerNetHandler {
|
||||||
|
|
||||||
fn CMPing(&self, _: &f9::MsgHdr, _: Rc::<RefCell::<cs_proto::CMPing>>) {
|
fn cm_ping(&self, _: &f9::MsgHdr, _: Rc::<RefCell::<cs_proto::CMPing>>) {
|
||||||
panic!("not implement");
|
panic!("not implement");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,9 +103,10 @@ pub trait MsgHandler {`;
|
|||||||
(item) => {
|
(item) => {
|
||||||
if (item.name[0] == 'C' &&
|
if (item.name[0] == 'C' &&
|
||||||
item.name[1] == 'M') {
|
item.name[1] == 'M') {
|
||||||
|
const finalyName = this.converLowCaseName(item.name);
|
||||||
data += `
|
data += `
|
||||||
|
|
||||||
fn ${item.name}(&self, _: &f9::MsgHdr, _: Rc::<RefCell::<cs::${item.name}>>) {
|
fn ${finalyName}(&self, _: &f9::MsgHdr, _: Rc::<RefCell::<cs::${item.name}>>) {
|
||||||
panic!("not implement");
|
panic!("not implement");
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
@ -368,6 +369,19 @@ func (this *${item.name}) LoadFromKv(kv map[string]interface{}) {
|
|||||||
return newName;
|
return newName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
converLowCaseName(name) {
|
||||||
|
let newName = 'cm';
|
||||||
|
let preIs_ = false;
|
||||||
|
for (let i = 2; i < name.length; ++i) {
|
||||||
|
if (name[i].charCodeAt(0) >= 65 && name[i].charCodeAt(0) <= 90) {
|
||||||
|
newName += '_' + name[i].toLowerCase();
|
||||||
|
} else {
|
||||||
|
newName += name[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newName;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(new PBTools).init();
|
(new PBTools).init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user