• Stars
    star
    101
  • Rank 338,166 (Top 7 %)
  • Language
    JavaScript
  • Created almost 11 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

pomelo-cocos2d-js client

#pomelo-cocos2d-js

pomelo-cocos2d-js is a library for using in pomelo with cocos2dx-js

#Usage using browserify to resolve library dependencies

add this library to your project

npm install pomelo-cocos2d-js --save

add to your browserify main.js

require('pomelo-cocos2d-js');

in cocos2d-js you can also add dist/pomelo-cocos2d-js.js file into jsList

then you can use pomelo object under the gloal window object the same as using in the browser

simple chat test

var pomelo = window.pomelo;

var route = 'gate.gateHandler.queryEntry';
var uid = "uid";
var rid = "rid";
var username = "username";

pomelo.init({
	host: "127.0.0.1",
	port: 3014,
	log: true
}, function() {
	pomelo.request(route, {
		uid: uid
	}, function(data) {
		pomelo.disconnect();
		pomelo.init({
			host: data.host,
			port: data.port,
			log: true
		}, function() {
			var route = "connector.entryHandler.enter";
			pomelo.request(route, {
				username: username,
				rid: rid
			}, function(data) {
				cc.log(JSON.stringify(data));
				chatSend();
			});
		});
	});
});

function chatSend() {
	var route = "chat.chatHandler.send";
	var target = "*";
	var msg = "msg"
	pomelo.request(route, {
		rid: rid,
		content: msg,
		from: username,
		target: target
	}, function(data) {
		cc.log(JSON.stringify(data));
	});
}

License

(The MIT License)

Copyright (c) 2012-2015 NetEase, Inc. and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

pomelo

A fast,scalable,distributed game server framework for Node.js.
JavaScript
11,871
star
2

tango

A code driven low-code builder, develop low-code app on your codebase.
TypeScript
2,047
star
3

UnitySocketIO

socket.io client for unity3d.
C#
890
star
4

lordofpomelo

the online demo of pomelo
JavaScript
797
star
5

amoro

Amoro is a Lakehouse management system built on open data lake formats.
Java
640
star
6

chatofpomelo

chat application of pomelo
JavaScript
299
star
7

pomelo-unityclient-socket

pomele dotnet client
C#
170
star
8

libpomelo2

A New Client SDK for Pomelo
C
133
star
9

libpomelo

[DEPRECATED] Please Go to https://github.com/NetEase/libpomelo2
C
116
star
10

pomelo-unityclient

pomelo client for unity3d.
C#
113
star
11

chatofpomelo-websocket

chatofpomelo with pomelo 0.3.0
JavaScript
101
star
12

arrow

A TestNG plugin with better test report template, re-run tests on failure, and many more.
Java
97
star
13

pomelo-rpc

rpc framework for pomelo
JavaScript
96
star
14

airtest

Deprecated, moved to http://airtest.netease.com
Python
93
star
15

treasures

a tutorial demo of pomelo
JavaScript
90
star
16

pomelo-androidclient

java&android client for pomelo
Java
83
star
17

pomelo-iosclient

iOS client lib for pomelo
Objective-C
68
star
18

pomelo-aoi

The aoi module used in lordofpomelo
JavaScript
59
star
19

pomelo-cocos2dchat

cocos2dchat based on cocos2d-x and libpomelo
C++
57
star
20

pomelo-admin

admin module for pomelo monitor system
JavaScript
51
star
21

pomelo-scheduler

the high performance schedule module for calling scheduled task
JavaScript
50
star
22

pomelo-ioschat

A chat demo for pomelo iOS client
Objective-C
49
star
23

hive-tools

Java
46
star
24

erlyssh

A Parallel SSH Execution Tool
Erlang
44
star
25

pomelo-sync

the backend database sync module
JavaScript
42
star
26

pomelo-robot

the client test framework for websocket
JavaScript
41
star
27

Polyphonic-TrOMR

TrOMR:Transformer-based Polyphonic Optical Music Recognition
Python
41
star
28

pomelo-unitychat-socket

pomelo-chat client based on socket, support unity 3D and other .net environment,
ASP
39
star
29

pomelo-cn

The Chinese issues for pomelo.
38
star
30

pomelo-admin-web

monitor server demo for pomelo admin system
JavaScript
36
star
31

pomelo-bt

behavior tree implementation for pomelo ai
JavaScript
34
star
32

pomelo-cli

pomelo-cli is a command-line library for pomelo maintenance
JavaScript
32
star
33

pomelo-androidchat

chat client application using android client for pomelo
Java
31
star
34

pomelo-robot-demo

pomelo-protocol
JavaScript
31
star
35

pomelo-mqtt-connector

pomelo mqtt connector based on mqtt over tcp and over ws protocol
JavaScript
30
star
36

pomelo-globalchannel-plugin

globalChannel plugin for pomelo
JavaScript
30
star
37

pomelo-protocol

pomelo-protocol
JavaScript
30
star
38

pomelo-logger

logger wrapper of log4js for pomelo logger system
JavaScript
26
star
39

pomelo-status-plugin

status plugin for pomelo
JavaScript
24
star
40

mebius

精准测试sdk
Java
23
star
41

c

Python
20
star
42

pomelo-zookeeper-plugin

zookeeper service for pomelo
JavaScript
19
star
43

nec

Netease's nec css framework,
CSS
18
star
44

pomelo-unitychat

ASP
17
star
45

opencurve

14
star
46

pomelo-sync-plugin

sync plugin for pomelo
JavaScript
14
star
47

pomelo-rpc-zeromq

pomelo rpc using zeromq for communication
JavaScript
13
star
48

tango-boot

A frontend framework for netease tango low-code app
TypeScript
12
star
49

pomelo-protobuf-plugin

plugin for pomelo protobuf
JavaScript
12
star
50

lakehouse-benchmark

A benchmark tool for lakehouses.
Java
11
star
51

pomelo-pathfinding

Path finding module used in lordofpomelo.
JavaScript
10
star
52

tango-components

An UI library for tango low-code builder
TypeScript
10
star
53

pomelo-dotnetchat-console

pomelo-chat client based on socket and .net
C#
10
star
54

pomelo-loader

loader module for pomelo to load handler and remote with the convention over configuration rules
JavaScript
10
star
55

example

C
9
star
56

pomelo-daemon

provide daemon process service for pomelo to deploy in distributed environments
JavaScript
9
star
57

ranger

Java
9
star
58

pomelo-scale-plugin

scale up service for pomelo
JavaScript
7
star
59

pomelo-masterha-plugin

master ha plugin for pomelo
JavaScript
7
star
60

pomelo-data-plugin

load data pomelo plugin
JavaScript
6
star
61

kyuubi-arctic-playground

Playbook of Kyuubi and Arctic Demo
Dockerfile
6
star
62

tango-playground

A playground app of tango low-code builder
TypeScript
5
star
63

pomelo-monitor

Simple, comprehensive monitoring tool for operating-system and process in nodejs.
JavaScript
5
star
64

lakehouse-benchmark-ingestion

A ingestion tool for Lakehouse benchmark
Java
4
star
65

pomelo-collection

Collection used for pomelo
JavaScript
4
star
66

airtest-gui

GUI write by qt for airtest
Python
3
star
67

pomelo-data-plugin-demo

pomelo-data-plugin demo
JavaScript
3
star
68

tango-site

Official site of NetEase Tango low-code builder
TypeScript
3
star
69

amoro-site

Documentation site for project Amoro
SCSS
2
star
70

amoro-medium

Medium materials for project Amoro
1
star