How to use the AsyncConnect function from bindings

Find comprehensive JavaScript bindings.AsyncConnect code examples handpicked from public code repositorys.

2
3
4
5
6
7
8
9
10
11

module.exports = function(callback){
        var port = 4396;
        if(process.argv.length >= 3)
                port = process.argv[2];
        cga.AsyncConnect(port, function(result){
                if(!result){
                        throw new Error('Failed to connect to game.');
                        return;
                }
fork icon35
star icon0
watch icon1

25
26
27
28
29
30
31
32
33
34
        port = parseInt(process.env.CGA_GAME_PORT);

if(typeof port != 'number')
        throw new Error('获取游戏本地服务端口失败!');

cga.AsyncConnect(port, function(err){
        if(err){
                throw new Error('无法连接到本地服务端口,可能未附加到游戏或者游戏已经闪退!');
        }
        
fork icon33
star icon44
watch icon5

+ 7 other calls in file

Other functions in bindings

Sorted by popularity

function icon

bindings.createKey is the most popular function in bindings (8616 examples)